package org.jeecg.modules.yc.web.entity;

import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * @Description: 报警记录
 * @Author: jeecg-boot
 * @Date:   2025-02-17
 * @Version: V1.0
 */
@Data
@TableName("yc_alarm_report")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="yc_alarm_report对象", description="报警记录")
public class YcAlarmReport implements Serializable {
    private static final long serialVersionUID = 1L;

	/**主键*/
	@TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键")
    private String id;
	/**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
	/**创建日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建日期")
    private Date createTime;
	/**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
	/**更新日期*/
	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新日期")
    private Date updateTime;
	/**所属部门*/
    @ApiModelProperty(value = "所属部门")
    private String sysOrgCode;
	/**告警类型*/
	@Excel(name = "告警类型", width = 15)
    @ApiModelProperty(value = "告警类型")
    private String type;
	/**告警设备Id*/
	@Excel(name = "告警设备Id", width = 15)
    @ApiModelProperty(value = "告警设备Id")
    private String deviceId;
	/**是否处理*/
	@Excel(name = "是否处理", width = 15)
    @ApiModelProperty(value = "是否处理")
    //@Dict(dicCode = "yc_is_solve")
    private String isSolve;
	/**处理人员*/
	@Excel(name = "处理人员", width = 15)
    @ApiModelProperty(value = "处理人员")
    private String solveUserId;
	/**汇集终端id*/
	@Excel(name = "汇集终端id", width = 15)
    @ApiModelProperty(value = "汇集终端id")
    @Dict(dictTable = "terminal", dicText = "name", dicCode = "id")
    private String terminalId;
	/**备注*/
	@Excel(name = "备注", width = 15)
    @ApiModelProperty(value = "备注")
    private String remark;
	/**处理结果*/
	@Excel(name = "处理结果", width = 15)
    @ApiModelProperty(value = "处理结果")
    @Dict(dicCode = "yc_solve_result")
    private String solveResult;
    /**报警内容*/
    @Excel(name = "报警内容", width = 15)
    @ApiModelProperty(value = "报警内容")
    private String alarmMsg;
    /**线路id*/
    @Excel(name = "线路id", width = 15)
    @ApiModelProperty(value = "线路id")
    @Dict(dictTable = "yc_line", dicText = "name", dicCode = "id")
    private String lineId;

	/**现场图片*/
	@Excel(name = "现场图片", width = 15)
    private transient String imgString;

    private byte[] img;

    public byte[] getImg(){
        if(imgString==null){
            return null;
        }
        try {
            return imgString.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return null;
    }

    public String getImgString(){
        if(img==null || img.length==0){
            return "";
        }
        try {
            return new String(img,"UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
	/**终端编号*/
	@Excel(name = "终端编号", width = 15)
    @ApiModelProperty(value = "终端编号")
    private String terminalNo;
	/**设备编号*/
	@Excel(name = "设备编号", width = 15)
    @ApiModelProperty(value = "设备编号")
    private String deviceNo;
}
